how to create an associative array in php

45

<?php
$arr = array('fruit' => 'mango', 'vegetable' => 'tomato', 'thing' => 'bag');
echo $arr['fruit'];
/*OUTPUT
mango*/
?>
Array
(
    [Ahmed] => Rofy
    [Abdallah] => Oda
    [Michel] => Mic
    [Yahia] => ENG
)

Comments

Submit
0 Comments